<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of optFlowLk</title>
  <meta name="keywords" content="optFlowLk">
  <meta name="description" content="Calculate optical flow using Lucas &amp; Kanade.  Fast, parallel code.">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html &copy; 2003 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../m2html.css">
</head>
<body>
<a name="_top"></a>
<!-- menu.html images -->
<h1>optFlowLk
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>Calculate optical flow using Lucas &amp; Kanade.  Fast, parallel code.</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>function [Vx,Vy,reliab]=optFlowLk( I1, I2, winN,winSig, sigma, thr, show ) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment"> Calculate optical flow using Lucas &amp; Kanade.  Fast, parallel code.

 Note that the window of integration can either be a hard square window of
 radius winN or it can be a soft 'gaussian' window with sigma winSig.
 In general the soft window should be more accurate.

 USAGE
  [Vx,Vy,reliab]=optFlowLk( I1, I2, winN, ...
    [winSig], [sigma], [thr], [show] )

 INPUTS
  I1, I2  - input images to calculate flow between
  winN    - window radius for hard window (=[] if winSig provided)
  winSig  - [] sigma for soft 'gauss' window (=[] if winN provided)
  sigma   - [1] amount to smooth by (may be 0)
  thr     - [3e-6] ABSOLUTE reliability threshold (min eigenvalue)
  show    - [0] figure to use for display (no display if == 0)

 OUTPUTS
  Vx, Vy  - x,y components of flow  [Vx&gt;0-&gt;right, Vy&gt;0-&gt;down]
  reliab  - reliability of flow in given window (cornerness of window)

 EXAMPLE
  % create square + translated square (B) + rotated square (C)
  A=zeros(50,50); A(16:35,16:35)=1;
  B=zeros(50,50); B(17:36,17:36)=1;
  C=imrotate(A,5,'bil','crop');
  optFlowLk( A, B, [], 2, 2, 3e-6, 1 );
  optFlowLk( A, C, [], 2, 2, 3e-6, 2 );
  % compare on stored real images (of mice)
  load optFlowData;
  [Vx,Vy,reliab] = optFlowLk( I5A, I5B, [], 4, 1.2, 3e-6, 1 );
  [Vx,Vy,reliab] = optFlowCorr( I5A, I5B, 3, 5, 1.2, .01, 2 );
  [Vx,Vy] = optFlowHorn( I5A, I5B, 2, 3 );

 See also <a href="optFlowHorn.html" class="code" title="function [Vx,Vy] = optFlowHorn( I1, I2, sigma, show )">OPTFLOWHORN</a>, <a href="optFlowCorr.html" class="code" title="function [Vx,Vy,reliab] = optFlowCorr( I1, I2, patchR, searchR,sigma, thr, show )">OPTFLOWCORR</a>

 Piotr's Image&amp;Video Toolbox      Version 2.0
 Copyright 2008 Piotr Dollar.  [pdollar-at-caltech.edu]
 Please email me if you find bugs, or have suggestions or questions!
 Licensed under the Lesser GPL [see external/lgpl.txt]</pre></div>

<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../matlabicon.gif)">
<li><a href="gaussSmooth.html" class="code" title="function [L,filters] = gaussSmooth( I, sigmas, shape, radius )">gaussSmooth</a>	Applies Gaussian smoothing to a (multidimensional) image.</li><li><a href="im.html" class="code" title="function varargout = im( I, range, extraInf )">im</a>	Function for displaying grayscale images.</li><li><a href="localSum.html" class="code" title="function I = localSum( I, dims, shape, op )">localSum</a>	Fast routine for box filtering.</li></ul>
This function is called by:
<ul style="list-style-image:url(../matlabicon.gif)">
</ul>
<!-- crossreference -->




<!-- Start of Google Analytics Code -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-4884268-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
<!-- end of Google Analytics Code -->

<hr><address>Generated by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" target="_parent">m2html</a></strong> &copy; 2003</address>
</body>
</html>
